% dvidoc.tex  Extension to docmac.tex. B. Langdon, Oct. 88.
%             Extended for math mode by Rainer M. Sch"opf (RmS)
%                          <Schoepf@sc.ZIB-Berlin.de>
% To use, do \input dvidoc, then \dvidoc before anything gets formatted.
% Don't change magnification.
% You may want different content for the ASCII file. Here's what I do:
% \ifdvidoc
%    stuff for ASCII file
% \else
%    stuff for normal laser printer output, e.g. math
% \fi
\newif\ifdvidoc  \dvidocfalse
\def\dvidoc{
  \font\docfont=doc     % a font in which all characters are same width
% the following are from docmac.tex.
  \textfont0=\docfont \scriptfont0=\docfont \scriptscriptfont0=\docfont
  \def\rm{\fam0\docfont}
  \textfont1=\docfont \scriptfont1=\docfont \scriptscriptfont1=\docfont
  \def\mit{\fam1} \def\oldstyle{\fam1\docfont}
  \def\it{\fam\itfam\docfont} % \it is family 4
  \textfont\itfam=\docfont
  \def\sl{\fam\slfam\docfont} % \sl is family 5
  \textfont\slfam=\docfont
  \def\bf{\fam\bffam\docfont} % \bf is family 6
  \textfont\bffam=\docfont \scriptfont\bffam=\docfont
  \scriptscriptfont\bffam=\docfont
  \def\tt{\fam\ttfam\docfont} % \tt is family 7
  \textfont\ttfam=\docfont
  \rm
% Would it work to have just redefined
% \tenrm, \sevenrm,...\teni,...\tenit,...etc as \docfont?
% Should that be done anyway, as in
  \let\tenrm=\docfont
  \let\sevenrm=\docfont         % smaller sizes don't exist.
  \let\fiverm=\docfont
%
  \textfont0=\docfont \scriptfont0=\docfont \scriptscriptfont0=\docfont
  \textfont1=\docfont \scriptfont1=\docfont \scriptscriptfont1=\docfont
  \textfont2=\docfont \scriptfont2=\docfont \scriptscriptfont2=\docfont
%
\mathcode`\*="612A
\mathcode`\-="612D
\mathcode`\\="015C
\mathcode`\/="612F
\mathcode`\.="612E
\mathcode`\,="612C
\mathcode`\{="417B
\mathcode`\|="417C
\mathcode`\}="417D
\mathcode`\'="0127
\mathcode`\<="013C
\mathcode`\>="013E
%
\def\alpha{{\tt alpha}}
\def\beta{{\tt beta}}
\def\gamma{{\tt gamma}}
\def\delta{{\tt delta}}
\def\epsilon{{\tt epsilon}}
\def\zeta{{\tt zeta}}
\def\eta{{\tt eta}}
\def\theta{{\tt theta}}
\def\iota{{\tt iota}}
\def\kappa{{\tt kappa}}
\def\lambda{{\tt lambda}}
\def\mu{{\tt mu}}
\def\nu{{\tt nu}}
\def\xi{{\tt xi}}
\def\pi{{\tt pi}}
\def\rho{{\tt rho}}
\def\sigma{{\tt sigma}}
\def\tau{{\tt tau}}
\def\upsilon{{\tt upsilon}}
\def\phi{{\tt phi}}
\def\chi{{\tt chi}}
\def\psi{{\tt psi}}
\def\omega{{\tt omega}}
\def\varepsilon{{\tt varepsilon}}
\def\vartheta{{\tt vartheta}}
\def\varpi{{\tt varpi}}
\def\varrho{{\tt varrho}}
\def\varsigma{{\tt varsigma}}
\def\varphi{{\tt varphi}}
\def\Gamma{{\tt Gamma}}
\def\Delta{{\tt Delta}}
\def\Theta{{\tt Theta}}
\def\Lambda{{\tt Lambda}}
\def\Xi{{\tt Xi}}
\def\Pi{{\tt Pi}}
\def\Sigma{{\tt Sigma}}
\def\Upsilon{{\tt Upsilon}}
\def\Phi{{\tt Phi}}
\def\Psi{{\tt Psi}}
\def\Omega{{\tt Omega}}
\def\aleph{{\tt aleph}}
\def\ell{{\tt l}}
\def\Re{{\tt re}}
\def\Im{{\tt Im}}
%
\mathchardef\times="2178
\mathchardef\lbrace="417B \let\{=\lbrace
\mathchardef\rbrace="417D \let\}=\rbrace
\mathchardef\langle="413C
\mathchardef\rangle="413E
\mathchardef\ldotp="612E % ldot as a punctuation mark
\mathchardef\cdotp="622E % cdot as a punctuation mark
\mathchardef\colon="603A % colon as a punctuation mark
%
\def\rightarrow{{\tt ->}}
\def\leftarrow{{\tt <-}}
\def\Longleftrightarrow{{\tt <=>}}
\let\Longrightarrow\rightarrow
\let\Longleftarrow\leftarrow
\def\gg{{\tt >>}}
\def\ll{{\tt <<}}
\def\leq{{\tt <=}} \let\le=\leq
\def\geq{{\tt >=}} \let\ge=\geq
\def\equiv{{\tt ==}}
\def\lnot{{\tt not }}
%
%\def\frac#1#2{((#1)/(#2))}
%
\def\"##1{\ifx ##1aae\else
          \ifx ##1ooe\else
          \ifx ##1uue\else
          \ifx ##1AAe\else
          \ifx ##1OOe\else
          \ifx ##1UUe\fi\fi\fi\fi\fi\fi}
%
\let\left\empty
\let\right\empty
\def\sum{\mathop{\rm\ sum }\limits}
\let\bullet=*
%
\def\to{{\tt ->}}
\def\circ{{\tt\ o }}
\def\mid{{\tt |}}
\def\parallel{{\tt ||}}
%
\advance\jot by 5pt
\advance\skip\footins by\baselineskip
%
% move footnote rule 6pt higher
\def\footnoterule{\kern-9pt
  \hrule width 2truein \kern 8.6pt\relax} % the \hrule is .4pt high
%
% docmac makes these work:
  \def\TeX{TeX}
  \def\LaTeX{LaTeX}
  \def\SliTeX{SliTeX}
  \def\BibTeX{BibTeX}
%
% horizontal dimensions had best be multiples of \em
  \hsize 78 em                  % 78 characters per line so fit any screen
  \rightskip=0pt plus 4em       % ragged right
  \spaceskip=1em                % forces ONE space between words
% \frenchspacing        suppresses extra blanks after punctuation -don't
  \parindent=5em
  \def\enspace{\kern 1em} \def\enskip{\hskip 1em\relax}
%
% vertical skips may best be multiples of \baselineskip
  \baselineskip=12pt            % 6 lines per inch
% \vsize                        % default give 58 lines -OK
  \voffset=\baselineskip        % so don't lose \headline
  \parskip=0pt
  \smallskipamount=0pt
  \medskipamount= \baselineskip
  \bigskipamount=2\baselineskip
  \raggedbottom
%
%%RmS
%% protect against font redefinitions
%
  \global\let\OrigFont=\font
  \def\font##1{\OrigFont##1=doc \OrigFont\ADummyControlSequence}
%
  \dvidoctrue
}


\dvidoc

\newskip\baselineskip

\endinput
